#include "widget.h"
#include "ui_widget.h"
#include <QPicture>
#include <QPainter>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QPicture picture;
    QPainter painter;
    painter.begin(&picture);
    painter.setPen(Qt::red);
    painter.drawEllipse(QPoint(100,100),100,100);
    painter.end();
    picture.save("C:\\Users\\14725\\Desktop\\picture.pic");
}

Widget::~Widget()
{
    delete ui;
}

void Widget::paintEvent(QPaintEvent *event)
{
    QPainter painter(this);
    QPicture picture;
    picture.load("C:\\Users\\14725\\Desktop\\picture.pic");
    painter.drawPicture(0,0,picture);
}

